package com.exercise.AndroidCamera;
/*
기능 : 로그아웃
작성 : 하드캔
완료일 : 2014.09.26 
	*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

/**
 * Activity which displays a login screen to the user, offering registration as
 * well.
 */
public class LogoutActivity extends Activity {

	Intent mIntent;
	String userID;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_logout);
		
		userID = getIntent().getExtras().getString("userID");

		findViewById(R.id.yes_logout_btn).setOnClickListener(
				new View.OnClickListener() {
					@Override
					public void onClick(View view) {
				    	mIntent = new Intent(LogoutActivity.this, LoginActivity.class);
				        mIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			    		startActivity(mIntent);
					}
				});
		
		findViewById(R.id.no_logout_btn).setOnClickListener(
				new View.OnClickListener() {
					
					@Override
					public void onClick(View view) {
						// TODO Auto-generated method stub
				    	mIntent = new Intent(LogoutActivity.this, MainActivity.class);
				        mIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				    	mIntent.putExtra("userID", userID);
			    		startActivity(mIntent);
					}
				});
		getActionBar().setTitle("Post Memories");
		getActionBar().setDisplayShowHomeEnabled(false);
	}
}
